package cn.yotta.user.api.params.captcha;

import cn.yotta.common.api.model.CheckValid;
import cn.yotta.common.utils.param.AssertUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import static cn.yotta.common.api.exception.BaseErrorCode.PARAM_IS_INVALID;

/**
 * @author wyaoyao
 * @date 2022/11/9 16:58
 */
@Data
@ApiModel("图片验证码校验参数")
public class CaptchaCheckRequest implements CheckValid {

    @ApiModelProperty("验证码值")
    private String value;

    @ApiModelProperty("token")
    private String token;

    @Override
    public void checkValid() {
        AssertUtil.notBlank(value,PARAM_IS_INVALID.getCode());
        AssertUtil.notBlank(token,PARAM_IS_INVALID.getCode());
    }
}
